<?php
/**
 * oci连接
 * 
 */


$conn = oci_connect("readonly", "7G70ggBZ", 'adDB');
$stmt = oci_parse($conn, "select * from admanager65.ng_ads where id<50");
oci_execute($stmt, OCI_DEFAULT);

header('Content-type:text/html; charset=gbk;');

echo '<table border=1>';
echo '<tr><th>ID</th> <th>TSTAMP</th> <th>ALTTEXT</th> <th>CLICKURL</th> <th>CREATEVEID</th></tr>';
while ($rs = oci_fetch_array($stmt)) {
	echo "<tr><td>{$rs[ID]}&nbsp;</td> <td>{$rs[TSTAMP]}&nbsp;</td> <td>{$rs[ALTTEXT]}&nbsp;</td> <td>{$rs[CLICKURL]}&nbsp;</td> <td>{$rs[CREATEVEID]}&nbsp;</td></tr>";
}
echo '</table>';
echo '共有 '.oci_num_rows($stmt).' 条结果，'.oci_num_fields($stmt).'列。';
?>